home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
sticpsrc.lzh
/
DOC
/
SCC.ARC
/
SCC.DOC
next >
Wrap
Text File
|
1990-03-02
|
19KB
|
443 lines
06601030305800
F0110030
9[...................................................]001
êTheZ8530SCCdriverfortheAtariSTandPCClonesÇ
ByR.E.Janssen,PE1CHL.
AdriverhasbeenwrittentosupportanumberofZ8530SCCchips
connectedtoanAtariSTcomputer.Thedriverisconfigurable
fordifferenthardwareconfigurations,andanexampleschematic
supportingupto7SCC's(14channels)hasbeenincluded.
ThedrivernowalsorunsonPCClones,althoughtheinterrupt
handlingcapabilitiesofthistypeofcomputerlimitsthemaximum
speedandnumberofchannelstoalowervaluethanontheAtari.
(dependingonthespeedofyourmachine)
Eachchannelmaybeindepentlyprogrammedtosupport:
-AnasynchronousSLIPline
-AnasynchronousinterfacetoaKISSTNC
-DirectAX.25(HDLC)
Thesoftwarehasbeenwritteninsuchawaythataportto
anotherenvironmentwhereZ8530SCC'sareavailableshouldbe
relativelystraightforward.Addressesofthechipsare
completelyconfigurable,andmostprobablyonlythefirst-level
interrupthandler(writteninassemblylanguage)hastobe
adaptedtothespecificconfigurationoftheinterrupt
acknowledgelogicinthesystem.
ThePCversionsupportsafewspecialtypesofinterfaceboard,
thatusespecificIOportstocontrolcertainon-boardfeatures
likeMODEMsandinterruptconfiguration.
êInitializationandattachmentofthechannelsÇ
Tousethedriver,2stepsmustbeperformed:
1.Globalinitializationofthedriver
2.Attachmentofeachchannel,specifyingmodeandoptions
TheglobalinitializationisneededtoresetallSCCsandto
installacommoninterrupthandler.Also,thehardwareaddresses
ofthechipsaredefinedinthisstep.Inthesecondstep,each
channelissetupfortheintendeduse.
♪≡ê1.InitializationÇ
Initializationisperformedusingthe"attachsccinit"command,
usingthefollowingsyntax:
attachscc<numberofchips>init<baseaddress>
<spacingbetweenchips><offsettochannelActrl>
<offsettochannelBctrl><offsetfromctrltodata>
<addressofINTACKlatch>|0<interruptnumber>
p<PCLKfrequency>|r<RTxCfrequency>
[<specialinterfacetype><interfaceparameter>]
Toinitializeaboardwith2SCCsusingmyschematic,the
followingcommandwouldbeused:
attach scc 2 init fffd00 8 3 7 -2 fffd3f 3 p4915200
Thisspecifiesinterruptnumber3,anormallyunusedinterruptin
520STand1040STmachines.InthenewerMega-STthisinterrupt
isusedfortheBlitter.Inthiscase,itispossibletousethe
"ringindicator"inputoftheRS232interfaceasaninterrupt
source.Ithasinterruptnumber14.
TheINTACKlatch(write,thenreadtogettheinterruptvector)
islocatedat0xfffd3f.Itisalsopossibletospecify0for
thisaddress.Inthatcase,INTACKisnotusedandthedriver
findstheinterruptingchipbypollingeachRR3Aregister.This
allowsamoresimplehardwaredesign,especiallyforPCs.
Thecrystalclockisspecifiedas4.9152MHz.Otherfrequencies
canbeused,andthisparametershouldbeadjustedaccordingly.
TheclockusedforbaudrategenerationisconnectedtoPCLK.It
wouldalsobepossibletosupplyabaudrateclocktoRTxC,anda
clockofadifferentfrequencytoPCLK(liketheprocessor
clock).Thisoptionisselectedbyprefixingtheclockfrequency
withan"r"insteadofa"p".
The"specialinterfacetype"and"interfaceparameter"fieldscan
beusedtospecifysomespecialtypeofinterfaceboardtobe
used.Thisrequiresmodificationtothedriversoftware.
Currently,thefollowingspecialtypesaresupportedonthePC:
-type1:EAGLE
-type2:PC-100
-type4:PRIMUS
-type8:DRSIPC*Packet
ThePC-100andthePRIMUSacceptaninterfaceparameter,thatis
usedtocontroltheon-boardMODEM.Itmustbespecifiedasa
hexadecimalvaluetobesenttotheoutputportontheboard.
♪∙ÇPossibleinitialisationcommandsare:
EAGLE:attach scc 1 init 2e8 8 2 0 1 0 2 p36864001
PC-100:attach scc 1 init 2e816 6 4 1 0 2 p4915200222
PRIMUS:attach scc 1 init 2e8 4 2 0 1 0 2 r2457600402
DRSI:attach scc 1 init 300 16 2 0 1 0 2 p49152008
WhenusinganAT-typemachine(withtwo8259interrupt
controllers),andusingthe"interrupt2"lineontheBUS,
specifyinterruptnumber9insteadof2.Thisbetterreflects
theactualconfiguration.TheBIOSwillattempttheredirection
ofinterruptvector#9to#2,butitdoesnotcompletelydothe
job.
TheSCCdriverusesthe"buffers"featurethatpre-allocatesa
numberofreceiverbufferstobeusedbythedriversatinterrupt
time.Besuretoissuea"buffers<n>"commandbeforeyouattach
anyoftheSCC'schannels(seebelow).The<n>parameterofthe
bufferscommandspecifiesthenumberofbufferstopre-allocate,
thisisafunctionofthenumberofchannelsyouwillattach,the
baudrateofthechannels,theactivityoneachofthesechannels,
andthetimethecomputercanspendwithoutre-allocatingnew
buffers.Agoodnumberofreceiverbufferstotryis32.Ifyou
seeanon-zeronumberinthe"Space"columnintheSCCSTAToutput
(seebelow)youcanincreasethisnumber.Itspecifiesthe
numberof128-bytebuffersthatarepre-allocatedforthe
receiverbuffersofallchannelsattached.Sointhiscase,
4Kbytesareallocated.
Itisalsopossibletosetthesizeofthebufferstobe
allocated,usingthe2ndand3rdargumentofthe"buffers"
command.Thesesetaminimalandmaximalsizeofeachbuffer.
ThePCversionwillonlyallocatebuffersofthemaximumsize
(andignoresthesecondargument),buttheAtariSTversions
minimizesthethrashingofthememoryfreelistbyallocating
buffersbetweentheminimalandmaximalsize,thatcanbecarved
outofthefreelistwithoutfurthersplittingblocksofmemory.
Example:buffers6410128
ê2.AttachcommandsÇ
WhentheSCCdriverhasbeeninitialized,youcanattachthe
channels.Thisisdoneusingoneof3formsofthe"attachscc"
command:
attachscc<channel>slip<mtu><baudrate>
attachscc<channel>kiss<mtu><baudrate><callsign>
attachscc<channel>ax25<mtu><baudrate><callsign>
Thesewillberefferredtoas"slip","kiss"and"ax25"mode.
ÇThe<channel>parameterspecifieswhichhalfofwhichSCCwillbe
programmed,asfollows:
channel0:"A"sideoffirstSCC
channel1:"B"sideoffirstSCC
channel2:"A"sideofsecondSCC
channel3:"B"sideofsecondSCC
etcetera.Thechannelnumberrangesfrom0to(2*nchips)-1,
wherenchipsisthenumberofchipsspecifiedinthe
"attachsccinit"command.
♪⑥êSLIPmodeÇ
Thiscanbeusedforalinktoanothermachine,whenthechannel
hasanRS232interface.Example:
attachscc0slipsl02569600
♪⑤Thisattachesthe"A"sideofthefirstSCCasinterface"sl0",
withanMTUof256andaninitialbaudrateof9600.Thebaudrate
canbechangedlaterby:
paramsl0<baudrate>
Enteringjust"paramsl0"willdisplaythecurrentbaudrate.
êKISSmodeÇ
KISSmodecanbeusedtotalktoaKISSTNC.Itcanalsobeused
onanasynchronouslinktoanothercomputerrunningNET.
ThedifferencewithSLIPisthattheinterfacewillbeAX.25
type,andcanthereforebeusedforAX.25connections.A
callsignmustbegivenasaparameter,thiswillbeusedforIP
andNET/ROMpurposesontheinterface.Example:
attach scc 2 kiss 430 256 4800 pe1chl-7
Intheexamplethe"A"sideofthesecondSCCwillbeattachedas
interface"430"usinganMTUof256,abaudrateof4800andthe
callsignPE1CHL-7.
Thecommand"param430<paramnum><decimalvalue>"canbeusedto
settheparametersoftheKISSTNC.Itisnotpossibleto
displaythecurrentsettings.
êAX.25modeÇ
Thisisprobablythemostintere